-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
makefiles/toolchain: fix command -v multiple commands #10889
Conversation
`command -v first second third` only works in `bash` and not in `sh`. So replace with multiple calls to `command`. This fixes using `objcopy` when the toolchain `objcopy` is not available.
Another update could be to define |
Tested on OS X, this is what I get, so... no change compared to master?
|
We checked IRL, and @emmanuelsearch does not have RIOT/boards/native/Makefile.include Lines 28 to 33 in 782b181
When replacing the last |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, works on macOS too (just to be sure).
Side node: looks like some tools should be queried for in a more central part of the build system than twice (the same) for gcc and llvm.
btw. I have |
We noticed with @jcarrano while discussing this, that the case from |
Contribution description
command -v first second third
only works inbash
and not insh
.So replace with multiple calls to
command
.This fixes using
objcopy
when the toolchainobjcopy
is not available.Testing procedure
I found this when building in docker with a machine without toolchain.
If you have your
arm
toolchain installed outside of the normal path you can try with the same procedure of changing the PATH.Or use another board you do not have the toolchain for.
With this PR
It fallback to
objcopy
:Original behavior is kept:
The
arm-none-eabi-gcc
error is unrelated to this PR and I think is related to #10850 and is also present inmaster
.Behavior in master
Master does not fallback to
objcopy
.Normal behavior was the same
Low level justification
Difference between bash and sh and
make
usessh
by default.Issues/PRs references
I notified this in #10870
Follow ups
Other boards/cpus are defining
objcopy
and other toolchains in their ownMakefile.include
when they should be using this one. It also goes for all the compiler variables.